Skip to content

Add switch aliases for compatibility with ldc2 and ldmd2 to dmd - #123

Merged
adamdruppe merged 3 commits into
opendlang:masterfrom
analogjupiter:O2
Aug 30, 2026
Merged

Add switch aliases for compatibility with ldc2 and ldmd2 to dmd#123
adamdruppe merged 3 commits into
opendlang:masterfrom
analogjupiter:O2

Conversation

@0xEAB

@0xEAB 0xEAB commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This adds the following switches to the driver of DMD:

  • -O<n>/-Os/-Oz/-Og/-Ofast
  • [-]-d--debug[=<identifier>]
  • [-]-d--version=<identifier>

0xEAB added 3 commits August 30, 2026 21:13
Optimization-level switches as supported by more popular compilers as well as *GDC* or *LDC* are now accepted.
As DMD does not actually implement support for multiple optimization levels,
these switches merely turn the optimizer on or off.

This streamlines the user experience to bring it in line with LDC's `ldmd2` wrapper.

DMD will conditionally accept multiple differing optimization-level switches in one compiler invocation.
This is as long as they do not effectively contradict each other with reference to the activation of the optimizer.

The extent of switches supported by the implementation is intended to match GDC 14.2.
This streamlines the user experience to bring it in line with `ldc2` as well as its `ldmd2` wrapper.
This streamlines the user experience to bring it in line with `ldc2` as well as its `ldmd2` wrapper.
@0xEAB

0xEAB commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

This is basically an extended version of dlang/dmd#23724.

@adamdruppe
adamdruppe merged commit 1b1415e into opendlang:master Aug 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants